Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 16: Binding Colors to Points, Lines, Faces, and Coordinates

../ch16/16fig06.gif
Figure 16.6

A checkerboard built using elevation-grid squares and colored using colors from a Color node.

16fig06.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Shape {
    appearance Appearance {
        material Material { }
    }
    geometry ElevationGrid {
        xDimension 8
        zDimension 8
        xSpacing   1.0
        zSpacing   1.0
        solid      FALSE
        height [
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
        ]
        colorPerVertex FALSE
        color DEF check Color {
            color [
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,  1.0 0.3 0.3,  0.2 0.2 0.2,
                1.0 0.3 0.3,  0.2 0.2 0.2,
            ]
        }
    }
}